CC = gcc
CFLAGS = -O2 -Wall
LFLAGS = -lm 

SOURCES=lz78.c compressore.c my_hash.c decompressore.c dec_table.c bitio.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=lz78

$(EXECUTABLE): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $@ $(LFLAGS)

lz78.o: compressore.h decompressore.h common.h

compressore.o: my_hash.h bitio.h compressore.h common.h

decompressore.o: dec_table.h bitio.h decompressore.h common.h

bitio.o: bitio.h common.h

my_hash.o: my_hash.h common.h

dec_table.o: dec_table.h common.h


clean: 
	@rm -f *.gc *.o *.out \(dec\)_*.* lz78
